package com.kethink.clsssify.jvm;

public class ClassRunTest {
    public static void main(String[] args) {
        Class demo1Class = Demo1.class;
        System.out.println("after Demo1.class");
        int i = Demo1.i1;
        System.out.println("after Demo1.i1");
        i = Demo1.i2;
        System.out.println("after Demo1.i2");
    }
    /* output
     * after Demo1.class
     * after Demo1.i1
     * loading Demo1
     * after Demo1.i2
     */
}

class Demo1 {
    static final int i1 = 47;
    static final int i2 = (int)(Math.random() * 10000);
    static {
        System.out.println("loading Demo1");
    }
}

